package com.example.map;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXLayer;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXLoader;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXLoader.ITMXTilePropertiesListener;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXProperties;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXTile;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXTileProperty;
import org.anddev.andengine.entity.layer.tiled.tmx.TMXTiledMap;
import org.anddev.andengine.entity.layer.tiled.tmx.util.exception.TMXLoadException;

import android.content.Context;

public class MyTitleMap {
	public static TMXTiledMap getTMXTitleMap(Context mContext, Engine mEngine, String mapName){
		TMXTiledMap tmxTiledMap = null;
		try {
			TMXLoader tmxLoader = new TMXLoader(mContext, mEngine.getTextureManager(), new ITMXTilePropertiesListener() {
				
				@Override
				public void onTMXTileWithPropertiesCreated(TMXTiledMap pTMXTiledMap,
						TMXLayer pTMXLayer, TMXTile pTMXTile,
						TMXProperties<TMXTileProperty> pTMXTileProperties) {
					// TODO Auto-generated method stub
					
				}
			});
			tmxTiledMap = tmxLoader.loadFromAsset(mContext, mapName);
		} catch (TMXLoadException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return tmxTiledMap;
	}

}
